//牛客 KY111 日期差值
//思路：分别记录出两个年月日各自的天数，最后相减+1

#include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;

int isLeapYear(int year)
{
    if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
        return 1;
    
    return 0;
}
int main()
{
    int MonthArray[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };

    int year1 = 0, month1 = 0, day1 = 0;
    int year2 = 0, month2 = 0, day2 = 0;
    scanf("%4d %2d %2d", &year1, &month1, &day1);
    scanf("%4d %2d %2d", &year2, &month2, &day2);

    int sum1 = 0, sum2 = 0;

    for(int i = 0; i < year1; i++)
    {
        if(isLeapYear(i))
            sum1 += 366;
        else
            sum1 += 365;
    }
    if(isLeapYear(year1))
    {
        MonthArray[2] = 29;
    }
    for(int i = 1; i < month1; i++)
    {
        sum1 += MonthArray[i];
    }
    sum1 += day1;


    for(int i = 0; i < year2; i++)
    {
        if(isLeapYear(i))
            sum2 += 366;
        else
            sum2 += 365;
    }
    if(!isLeapYear(year2))
    {
        MonthArray[2] = 28;
    }
    for(int i = 1; i < month2; i++)
    {
        sum2 += MonthArray[i];
    }
    sum2 += day2;

    cout << abs(sum1 - sum2)+1 << endl;

    return 0;
}